package net.scratch.netty.net;

import net.scratch.netty.net.codec.JS5HandshakeDecoder;
import net.scratch.netty.net.codec.MessageEncoder;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;

public class ServerPipelineFactory implements ChannelPipelineFactory {

	@Override
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = Channels.pipeline();
		pipeline.addLast("rs2encoder", new MessageEncoder());
		pipeline.addLast("rs2decoder", new JS5HandshakeDecoder());
		pipeline.addLast("handler",    new TCPManager());
		return pipeline;
	}

}
